<? 
		
	require("required/dbconnect.php"); 
	require_once("required/function.php");
	require("required/header.php");
	checkAccess("allow_content_management",1);
	
	$id=mysql_real_escape_string($_GET['id']);
	$get_id=mysql_query("select * from os_announcement where id='$id'");

	$a=mysql_fetch_array($get_id,MYSQL_ASSOC);
	
?>
	<script src="required/js/jquery-1.4.2.js"></script>
<script src="required/js/common_javascript.js"></script>
<?
if(!empty($_GET['action']))
	{
		
		switch($_GET['action'])
		{
			case 1:
				$msg="<div class='dw_success'>Data inserted</div>";
				
				break;
			case 2:
				$msg="<div class='dw_success'>Data Deleted</div>";
				
				break;
			case 3:
				$msg="<div class='dw_success'>Data Updated</div>";
				break;	
			default:
				$msg="Invalid";
				break;
		}
		
		echo "<script>displayMsg('divMsg')</script>";	
	}else{
		$msg="";
	}

?>		
				<table width="100%"  cellpadding="5" cellspacing="0" height="300">
					<td class="title" colspan="3"><strong>Announcement</strong>
			 		<div id="divMsg"><?= $msg ?></div>
                    </td>
                    <tr>
					<td width="100%" align="left" valign="top">
						
						<table width="100%">
								
						 	<tr valign="top">
                                <td width="100">Title</td><td width="20">:</td>
                                <td>
                                   <?= $a['title'] ?>
                                </td>
                            </tr>
                            <tr>
                                <td>Content Type</td><td>:</td><td><?= $a['content_type'] ?></td>
                            </tr>
                            <tr valign="top">
                                <td>Brief Description</td><td>:</td>
                                <td>
                                    <?= str_replace("\n","<br>",$a['brief_description']) ?>
                                </td>
                            </tr> 
                                
                            <tr>
								<td>Date</td><td>:</td><td><?= $a['create_date'] ?></td>
                            </tr>
                            <tr>
                                <td>Show</td><td>:</td><td><?= convertStatus($a['status']) ?></td>
                            </tr>
						 	<tr valign="top">
                            	<td>Picture</td><td>:</td>
                                <td>
                                	<?
										if($a["pic"]=="")
										{
											$pic="empty";
											$piclink="noimage.jpg";
											$fix="";
										}
										else
										{
											$piclink=$a['pic'];
											$width=$a['width'];
											$height=$a['height'];
											
											if($width-$height>0)
											{
												$fix="width=200";
											}
											else
											{
												$fix="height=180";
											}						
											
										}					
									?>
                                   <img src="../announcement_pic/<?= $piclink ?>" <?= $fix ?>><br>
                                   [<a href="announcement_pic_edit.php?id=<?= $id ?>">Edit Pictures</a>]
                      			</td>
                            </tr>
                           
                       
                            <tr valign="top">
                                <td>Content</td><Td>:</Td>
                            </tr>
                            <tr>    
                                <td valign="top" colspan="3">
                                  
                                   <?= $a['content_eng'] ?>
                                    
                                </td>
                            </tr>
                            <tr valign="top">
                                <td><br>
                                </td>
                            </tr>
                            
                            <tr>
                                <td colspan="2">
                                
                         
                                
                                
                                <input type="button" value="Edit" name="btnsubmit" onclick="window.open('announcement_edit.php?id=<?= $id ?>','_self')">
                                 <input type="button" value="Back" name="btnsubmit" onclick="window.open('announcement_viewall.php','_self')">
                                
                                </td>
                            </tr>
						</table>
						
					</td>
				 	</tr>
				</table>
<? require("required/footer.php"); ?>